<template>
  <div class="header_box">
    <span class="goback" v-on:click="back" v-show="isShow"
      ><van-icon name="arrow-left" />返回
    </span>
    午夜DJ
  </div>
</template>

<script>
export default {
  name: '',
  data() {
    return {
      isShow: false
    }
  },
  components: {},
  created() {},
  mounted() {},
  watch: {
    $route(now, old) {
      if (now.path === '/home') {
        this.isShow = false
      } else {
        this.isShow = true
      }
    }
  },

  methods: {
    back() {
      this.$router.go(-1)
    }
  }
}
</script>
<style lang="less" scoped>
.header_box {
  width: 100%;
  height: 40px;
  background: #1989fa;
  text-align: center;
  line-height: 40px;
  color: #fff;
  font-size: 14px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1;
}
.goback {
  position: fixed;
  display: flex;
  align-items: center;
  left: 15px;
}
</style>
